import React from 'react';
import styles from './GoodsItem.css';

function GoodsItem(props) {
  return (
    <tr className={styles.normal}>
      <td>{props.id}</td>
      <td>{props.isbn}</td>
      <td>{props.title}</td>
      <td>{props.prise}</td>

      <td>
        <a href="#" onClick={(e) => {
          e.preventDefault()
          props.dispatch({type: 'goods/del', id: props.id})
        }}>删除</a>
        <a href="#" onClick={(e) => {
          e.preventDefault()
          props.dispatch({type: 'goods/toupd', id: props.id})
        }}>更新</a>
      </td>
    </tr>
  );
}

export default GoodsItem;
